package com.firmye.codereposboot.controller.btable;

import com.firmye.codereposboot.model.commons.BTResponse;
import com.firmye.codereposboot.service.BTableService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/btable")
@Slf4j
public class BTableController {

    @Autowired
    private BTableService bTableService;

    @PostMapping("/list")
    public BTResponse getList(HttpServletRequest request){
        try{
            return bTableService.getData(request);
        }catch (Exception e){
            log.error("=====> 获取数据失败:", e);
            return new BTResponse();
        }
    }

}
